/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package z.h.w.jar.data.time.period;

import java.util.Date;
import java.util.Map;
import z.h.w.jar.data.time.Attr;
import z.h.w.jar.data.time.Place;
import z.h.w.jar.data.time.Time;
import z.h.w.jar.data.time.Unit;
import z.h.w.jar.kit.method.To;

/**
 *
 */
public abstract class AbstractPeriod  extends Eyewink {

     /**
      * 
      * @param start
      * @param end
      */
     public AbstractPeriod ( Date start , Date end ) {
      super( start , end );
   }

   /**
    *
    * @param start end
    * @param end
    */
   public AbstractPeriod ( Time start , Time end ) {
      super( start , end );
   }

   /**
    *
    * @param sillabare
    */
   public AbstractPeriod ( Eyewink sillabare ) {
      super( sillabare );
   }

   /**
    *
    * @param lastable
    */
   public AbstractPeriod ( Lastable lastable ) {
      super( lastable );
   }

   /**
    *
    * @param time unit
    * @param unit
    */
   public AbstractPeriod ( Time time , Unit unit ) {
      this( time , 1.0 , unit );
   }

   /**
    *
    * @param time1 time2
    * @param time2  
    */
   public AbstractPeriod ( String time1 , String time2 ) {
      this( To.string2Time( time1 ) , To.string2Time( time2 ) );
   }

   /**
    *
    * @param multiple unit
    * @param unit
    */
   public AbstractPeriod ( Double multiple , Unit unit ) {
      super( multiple , unit );
   }

   /**
    *
    * @param start am multiple unit
    * @param multiple
    * @param unit
    */
   public AbstractPeriod ( Time start , Double multiple , Unit unit ) {
      super( start , multiple , unit );
   }

   /**
    * 时间缩小扩张
    * <p/>
    * @param period < p/>
    * <p/>
    * @return
    */
   public abstract AbstractPeriod expand ( AbstractPeriod period );

   /**
    * 时间段偏移
    * <p/>
    * @param multiple unit
    * <p/>
    * @param unit 
    * @return
    */
   public abstract AbstractPeriod offset ( Double multiple , Unit unit );

   /**
    * 总时间单位换算
    * <p/>
    * @param unit < p/>
    * <p/>
    * @return
    */
   public abstract Double to ( Unit unit );

   /**
    * 获取时间信息
    * <p/>
    * @param attr < p/>
    * <p/>
    * @return
    */
   public abstract Map<Time , String> tell ( Attr attr );

   /**
    * 
    * @param multiple
    * @param margin
    * @param unit
    * @return
    */
   public abstract AbstractPeriod[] split ( Double multiple , Double margin , Unit unit );

   /**
    * 
    * @param bma
    * @param period
    * @return
    */
   public abstract Boolean is ( Place bma , Date period );

   /**
    * 判断时间位置关系
    * <p/>
    * @param place
    * @param time
    *
    * @return
    */
   public abstract Boolean is ( Place place , Time time );

   /**
    *
    * @param place
    * @param period
    *
    * @return
    */
   public abstract Boolean is ( Place place , Period period );

    
}
